﻿using System.Linq;
using ReagentStore.ERM;
using ReagentStore.UTL;

namespace ReagentStore.BLL
{
	public static class ProductExtension
	{
		public static ColorPairs GetColorPairs(this Product product)
		{
			var bll = new ProductBLL();
			bool expirated = bll.GetExpirationList().Select(p => p.ProductID).Contains(product.ProductID);

			return expirated ? ReagentColorParis.Critical : ReagentColorParis.Normal;
		}

		public static int Quantity(this Product product)
		{
			return new ProductBLL().GetQuantity(product);
		}
	}
}